<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        //   const pig = [
        //     {
        //       uname: 'ikun',
        //       age: 2.5,
        //     },
        //   ]

        //   let [{ uname, age }] = pig

        //   console.log(uname, age)

        const pig = {
            name: '佩奇',
            family: {
                mother: '猪妈妈',
                father: '猪爸爸',
                brother: '乔治',
            },
            age: 5,
        }

        // let name = pig.name
        // let uname = pig.name
        // let harrysName = pig.name

        // let { mother, father, brother } = pig.family

        let { name: myName, age, family: { mother: myMother, father, brother }, family: myFamily } = pig

        console.log(myName, age, myMother, father, brother, myFamily);

        // let { name, name: uname, name: harrysName } = pig

        // console.log(name, uname, harrysName);
    </script>
</body>

</html>